package com.yinggu.utils;

public class Page {
    private int currentPage;
    private int pageSize;
    private int totalCount;
    private int totalPage;

    public Page() {

    }

    public Page(int currentPage, int pageSize, int totalCount) {
        this.currentPage = currentPage;
        this.pageSize = pageSize;
        this.totalCount = totalCount;
        this.totalPage = this.totalCount % this.pageSize == 0 ? this.totalCount/this.pageSize : this.totalCount/this.pageSize+1;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {

        this.pageSize = pageSize;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
        this.totalPage = this.totalCount % this.pageSize == 0 ? this.totalCount/this.pageSize : this.totalCount/this.pageSize+1;
    }

    public int getTotalPage() {
        return totalPage;
    }
}
